﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace com.dz.ct.ui
{
    public partial class FrmConfig : Form
    {
        /// <summary>
        /// 线程数量
        /// </summary>
        public int ThreadCount { get; set; }

        /// <summary>
        /// 书籍SQL
        /// </summary>
        public string BookSQL { get; set; }

        public FrmConfig()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 选择线程数量
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnStart_Click(object sender, EventArgs e)
        {
            int t_thread_count = 0;
            if (!int.TryParse(txtThreadCount.Text.Trim(), out t_thread_count))
                t_thread_count = 0;
            if (t_thread_count == 0)
            {
                MessageBox.Show("请输入线程数量!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            ThreadCount = t_thread_count;
            BookSQL = txtBookSQL.Text.Trim();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
